//-------------------------------------------------------------------
//	Copyright (c) 2010-2011  Zhirnov Andrey
//	This file is part of the "UXGEN_ResourceConverter" project.
//	See copyright notice in "Converter.h".
//-------------------------------------------------------------------

#ifndef _RC_IL_WRAPPER_H
#define _RC_IL_WRAPPER_H

#include "stdafx.h"

#include "IL\\il.h"
#include "IL\\ilu.h"
#include "IL\\ilut.h"


class ILWrapper
{
protected:
	ILuint			_uImage;
	E_TEXTURE_TYPE	_eType;

public:
	ILWrapper();
	~ILWrapper();
	
	bool ConvertILFormat(ILint fmt, ILint type, ILint dxfmt, int chan, e_tex_format::type &eFormat, e_tex_swizzle::type &eSwizzle);
	
	bool LoadTexture(const char *pcFileName, E_TEXTURE_TYPE &eType);
	void DeleteTexture();

	bool GetTexture1D(TImage1D &sImage);
	bool GetTexture2D(TImage2D &sImage);
	bool GetTexture3D(TImage3D &sImage);
	bool GetTextureCube(array<TImage2D> &aImages);
	bool GetTexture1DArray(array<TImage1D> &aImages);
	bool GetTexture2DArray(array<TImage2D> &aImages);

	E_TEXTURE_TYPE GetTexType() const	{ return _eType; }
};

#endif	// _RC_IL_WRAPPER_H